home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / BASE_M_V.C < prev    next >
C/C++ Source or Header  |  1992-08-16  |  3KB  |  87 lines

  1. //
  2. // Copyright (C) 1992 General Electric Company
  3. //
  4. // Permission is granted to any individual or institution to use, copy, modify,
  5. // and distribute this software, provided that this complete copyright and
  6. // permission notice is maintained, intact, in all copies and supporting
  7. // documentation.
  8. //
  9. // General Electric Company provides this software "as is" without
  10. // express or implied warranty.
  11. //
  12. // Updated: VDN 02/21/92 -- New lite version
  13. //
  14.  
  15. #ifndef BASE_M_VECTORH                // If no CoolBase_M_Vector class,
  16. #include <cool/Base_M_Vector.h>            // Include header file
  17. #endif    
  18.  
  19. // CoolBase_M_Vector -- Constructor specifiying size of vector
  20. // Input:    length
  21. // Output:   None
  22.  
  23. CoolBase_M_Vector::CoolBase_M_Vector (unsigned int elmts) {
  24. #if ERROR_CHECKING
  25.   if (elmts <= 0)    {            // If invalid size specified
  26.     //RAISE (Error, SYM(CoolBase_M_Vector), SYM(Invalid_Length),
  27.     printf ("CoolBase_M_Vector::CoolBase_M_Vector(): Invalid size %d specified for length.\n", elmts);
  28.     abort ();
  29.   }
  30. #endif
  31.   this->num_elmts = elmts;            // Save elmt count
  32. }
  33.  
  34.  
  35. // CoolBase_M_Vector -- constructor for reference to another CoolBase_M_Vector object
  36. // Input:    CoolBase_M_Vector reference
  37. // Output:   None
  38.  
  39. CoolBase_M_Vector::CoolBase_M_Vector (const CoolBase_M_Vector& m) {
  40.   this->num_elmts = m.num_elmts;        // Copy elmt count
  41. }
  42.  
  43.  
  44. // CoolBase_M_Vector -- Destructor for CoolBase_M_Vector
  45. // Input:    None
  46. // Output:   None
  47.  
  48. CoolBase_M_Vector::~CoolBase_M_Vector () {;}
  49.  
  50.  
  51. // index_error -- Raise exception for invalid row index.
  52. // Input:           function string, type string, index specification
  53. // Output:          None
  54.  
  55. void CoolBase_M_Vector::index_error (const char* fcn, const char* type, int index) const {
  56.   //RAISE (Error, SYM(CoolBase_M_Vector), SYM(Invalid_Index),
  57.   printf ("CoolBase_M_Vector<%s>::%s: Invalid value %d specified for index.\n", 
  58.       type, fcn, index);
  59.   abort ();
  60. }
  61.  
  62. // dimension_error -- Raise exception for invalid dimensions
  63. // Input:           function string, type string, rowXcol,rowXcol
  64. // Output:          None
  65.  
  66. void CoolBase_M_Vector::dimension_error (const char* fcn, const char* type, 
  67.                    int l1, int l2) const {
  68.   //RAISE (Error, SYM(CoolBase_M_Vector), SYM(Invalid_Dim),
  69.   printf ("CoolBase_M_Vector<%s>::%s: Dimensions [%d] and [%d] do not match.\n", 
  70.       type, fcn, l1, l2);
  71.   abort ();
  72. }
  73.  
  74.  
  75. // va_arg_error -- Raise exception for using class objects, or chars in (...)
  76. // Input:          Type string
  77. // Output:         None
  78.  
  79. void CoolBase_M_Vector::va_arg_error (const char* Type, int n) {
  80.   //RAISE (Error, SYM(CoolBase_M_Vector), SYM(Invalid_Va_Arg),
  81.   printf ("CoolBase_M_Vector<%s>::CoolBase_M_Vector<%s>(): Invalid type in ... or wrong alignment with %d bytes.\n",
  82.       Type, Type, n);
  83.   abort ();
  84. }
  85.  
  86.  
  87.